package com.teamwings.common.exception;

/**
 * 一般异常，用于通知用户修改某些数据
 */
public class ResultException extends RuntimeException {

    private String message;

    /**
     * 返回代码
     */
    private Integer code = 400;

    public ResultException(String message) {
        super(message);
        this.message = message;
    }

    public ResultException(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    public ResultException(String message, Integer code) {
        super(message);
        this.message = message;
        this.code = code;
    }

    public ResultException(String message, Integer code, Throwable e) {
        super(message, e);
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
